/* 
 * jxListFiles Project (2012, 2013, 2014)
 * 
 * by Denilson Edinaldo Pinto
 * 
 * GPL
 * Copyright (C) 2014
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
 */
package org.jxListFiles;

import org.jxListFiles.view.InitFrame;

import javax.swing.UIManager;

import java.awt.EventQueue;
import java.io.File;
import java.text.SimpleDateFormat;

/**
 * @author Denilson Edinaldo Pinto
 * @porject jxListFiles
 * @package org.jxListFiles
 * @date 16/12/2013 - 20:42:20
 */
public final class RunJxListFiles {
	
	private static final SimpleDateFormat FORMAT = new SimpleDateFormat("yyyy-MM-dd");
	
	private static final File RUN_DIR = new File(new File(ClassLoader.getSystemClassLoader().getResource("").getFile()).getParent().replace("%20", " "));
	
	private static final File DATA_DIR = new File(RUN_DIR, "data/");
	
	private static final File LOG_DIR = new File(RUN_DIR, "log/");
	
	private static final File SETTING_DIR = new File(RUN_DIR, "setting/");
	
	/**
	 * @param args
	 */
	public static void main(String[] args) {
	
		// 
		EventQueue.invokeLater(new Runnable() {
			
			@Override
			public void run() {
			
				try {
					UIManager.setLookAndFeel("com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel");
					
				}catch(Throwable throwable) {
					// ignore
				}
				
				new InitFrame();
			}
		});
	}
	
	/**
	 * @return the format
	 */
	public static SimpleDateFormat getFormat() {
	
		return FORMAT;
	}
	
	/**
	 * @return the dataDir
	 */
	public static File getDataDir() {
	
		return DATA_DIR;
	}
	
	/**
	 * @return the logDir
	 */
	public static File getLogDir() {
	
		return LOG_DIR;
	}
	
	/**
	 * @return the runDir
	 */
	public static File getRunDir() {
	
		return RUN_DIR;
	}
	
	/**
	 * @return the settingDir
	 */
	public static File getSettingDir() {
	
		return SETTING_DIR;
	}
}
